guint separator_label : 1;
guint with_separators : 1;
guint has_separator : 1;
+ guint is_fake : 1;
gulong handler;
};
i++;
}
- should_have_separator = could_have_separator && n_items != 0;
+ should_have_separator = !section->is_fake && could_have_separator && n_items != 0;
if (should_have_separator > section->has_separator)
{
* The only other thing that '->model' is used for is in the
* case that we want to show a separator, but we will never do
* that because separators are not shown for this fake section.
- *
- * Because of the game we play where the menu item is
- * essentially its own section, it is possible that the menu
- * item itself could get added as its own separator label in
- * the case that the item is inside of a with_separators
- * section, but this should never happen -- the user should
- * always have the menu item inside of a <section>, never at
- * the toplevel. It would be easy to add an extra boolean to
- * check for that, but we already have a lot of those...
*/
if (_gtk_menu_tracker_item_may_disappear (item))
{
GtkMenuTrackerSection *fake_section;
fake_section = g_slice_new0 (GtkMenuTrackerSection);
+ fake_section->is_fake = TRUE;
fake_section->model = g_object_ref (item);
fake_section->handler = g_signal_connect (item, "visibility-changed",
G_CALLBACK (gtk_menu_tracker_item_visibility_changed),